<div class="row m-n">
    <div class="crumbs-bar">
        <div yb-crumbs></div>
    </div>
    <div tabset type="tab">
        <div tab heading="包装规格管理" active="activeFlag[0]" ng-click="changeTab(0)">
            <div class="row wrapper-y-sm">
                <div class="operate-bar col-xs-6 font-0">
                    <button class="btn btn-operate m-r-sm" ng-click="addData()" ng-disabled="!btnPermission.packageAdd"
                        translate translate-attr-title="{{!btnPermission.packageAdd ?'无权限执行此操作':''}}">新增</button>
                </div>
                <div class="search-bar wrapper-none col-xs-6">
                    <div class="btn-group m-l-xs pull-right">
                        <button type="button" class="btn btn-default base-color" ng-click="search()" translate
                            translate-attr-title="刷新">
                            <i class="yb-icon ico-refresh"></i>
                        </button>
                        <button type="button" class="btn btn-default base-color" translate translate-attr-title="配置表格列"
                            ng-click="switchToolbar('ColConfig');">
                            <i class="yb-icon ico-set"></i>
                        </button>
                    </div>
                    <button class="btn-advance pull-right m-l-xs" ng-click="switchToolbar('AdvanceSearch')"
                        translate-attr-title="高级搜索" translate="高级搜索more"></button>
                    <div class="input-group pull-right clearfix" ng-style="{'width':isEN?'280px':'240px'}">
                        <input type="text" class="form-control txt-search" translate
                            translate-attr-placeholder="包装箱编码" ng-model="condition.packageNo">
                        <span class="input-group-addon cursor-pointer" ng-click="search(1)" translate>搜索</span>
                    </div>
                </div>
            </div>
            <div yb-advance-search show-toolbar="toolbarConfig.showAdvanceSearch" search-data="search(1)"
                reset-data="reset()">
                <div class="advance-search m-t-sm">
                    <div class="form-group clearfix">
                        <label class="control-label"><span translate>包装箱编码</span>：</label>
                        <input type="text" ng-model="condition.packageNo" class="form-control">
                    </div>

                </div>
            </div>
            <div yb-col-config show-toolbar="toolbarConfig.showColConfig" ng-model="tableConfig" col-fixed="true"
                has-check-col="true" set-tb-style="setFixedWidth()"></div>
            <div class="main-area" ng-style="{'top':isEN?'110px':'85px'}">
                <div yb-table-fixed class="table-fixed-wrap fix-left" ele-count="4" scroll-area="right">
                    <div class="th-fixed">
                        <table class="table-fixed border-none" width="{{tableConfig.fixedWidth}}">
                            <thead>
                                <tr>
                                    <!-- <th width="40" class="text-center th-check border-l-none">
                                        <div yb-check-box yb-checked="markInfo.allChecked" yb-click="selectAll()"></div>
                                    </th> -->
                                    <th ng-repeat="itemCol in tableConfig.tableCol track by $index"
                                        width="{{itemCol.width}}" ng-click="toSort(tableConfig.tableCol, $index)"
                                        ng-show="!!itemCol.isShow && !!itemCol.isFixed && (itemCol.type!=='cost' || costPriceShow)">
                                        <div yb-thead-operate ng-model="itemCol" target-width="tableConfig.fixedWidth"
                                            fixed-width="tbStyle.scrollLeft"></div>
                                    </th>
                                </tr>
                            </thead>
                        </table>
                    </div>
                    <div class="th-scroll-x" ng-style="tbStyle.scrollLeft">
                        <table class="table-fixed border-none" width="{{tableConfig.scrollWidth}}">
                            <thead>
                                <tr>
                                    <th ng-repeat="itemCol in tableConfig.tableCol track by $index"
                                        width="{{itemCol.width}}" ng-click="toSort(tableConfig.tableCol, $index)"
                                        ng-show="!!itemCol.isShow && !itemCol.isFixed && (itemCol.type!=='cost' || costPriceShow)">
                                        <div yb-thead-operate ng-model="itemCol" target-width="tableConfig.scrollWidth">
                                        </div>
                                    </th>
                                </tr>
                            </thead>
                        </table>
                    </div>
                    <div class="td-scroll-y" ng-show="dataList.length > 0">
                        <table class="table-fixed border-none" width="{{tableConfig.fixedWidth}}">
                            <tbody>
                                <tr ng-repeat="item in dataList track by $index"
                                    ng-class="{'row-selected': $index === markInfo.curMaterialRow}"
                                    ng-click="selectRow($index, 'Material')">
                                    <!-- <td width="40" class="text-center border-l-none">
                                        <div yb-check-box yb-checked="item.isChecked" yb-click="selectSingle(item)">
                                        </div>
                                    </td> -->
                                    <td class="spill-dots border-l-none border-r-none" ng-repeat="itemCol in tableConfig.tableCol track by $index"
                                        width="{{itemCol.width}}"
                                        ng-show="!!itemCol.isShow && !!itemCol.isFixed && (itemCol.type!=='cost' || costPriceShow)"
                                        title="{{ itemCol.dataField !== 'minimumBuy' ? item[itemCol.dataField] : (item.isMinimumBuy ? item[itemCol.dataField] : '')}}">
                                        <div class="font-0" ng-if="itemCol.type === 'operate'">
                                            <button class="btn btn-operate m-r-xs" ng-click="editData(item)"
                                                ng-disabled="!btnPermission.packageEdit" translate
                                                translate-attr-title="{{!btnPermission.packageEdit?'无权限执行此操作':''}}">编辑</button>
                                        </div>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                    <div class="td-scroll" ng-show="dataList.length > 0" ng-style="tbStyle.scrollLeft">
                        <table class="table-fixed border-none" width="{{tableConfig.scrollWidth}}">
                            <tbody>
                                <tr ng-repeat="item in dataList track by $index"
                                    ng-class="{'row-selected': $index === markInfo.curMaterialRow}"
                                    ng-click="selectRow($index, 'Material')">
                                    <td class="spill-dots" ng-repeat="itemCol in tableConfig.tableCol track by $index"
                                        width="{{itemCol.width}}"
                                        ng-show="!!itemCol.isShow && !itemCol.isFixed && (itemCol.type!=='cost' || costPriceShow)"
                                        title="{{ itemCol.dataField !== 'minimumBuy' ? item[itemCol.dataField] : (item.isMinimumBuy ? item[itemCol.dataField] : '')}}">
                                        <span
                                            ng-if="!itemCol.clickFn && itemCol.type !== 'operate' && itemCol.dataField !== 'minimumBuy'">{{item[itemCol.dataField]}}</span>
                                        <span
                                            ng-if="itemCol.dataField === 'minimumBuy' && item.isMinimumBuy">{{item[itemCol.dataField]}}</span>
                                        <a class="btn-operate m-r-xs" ng-click="tdClick(item, itemCol.clickFn)"
                                            ng-if="!!itemCol.clickFn">
                                            {{item[itemCol.dataField]}}
                                        </a>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                    <div class="no-data w-full text-center p-t" ng-show="dataList.length === 0" translate>暂时没有数据</div>
                </div>
            </div>
        </div>


        <div tab heading="{{tabFlag.name}}" active="activeFlag[1]" ng-if="activeFlag[1]">
            <div class="main-area d-t-35 d-b-60">
                <form name="form" class="main-wrap form-horizontal single-col p-t-xs clearfix" novalidate>
                    <div class="panel-bar clearfix">
                        <div class="pull-left">
                            <i></i><span translate>包装规格详细信息</span>
                        </div>
                        <!-- <div class="pull-right" ng-click="switchDetailBar(0)">
                            <span ng-show="!detailFlag[0]" translate translate-attr-title="展开">
                                <i class="yb-icon ico-angle-double-down"></i>
                            </span>
                            <span ng-show="detailFlag[0]" translate translate-attr-title="收起">
                                <i class="yb-icon ico-angle-double-up"></i>
                            </span>
                        </div> -->
                    </div>
                    
                    <div class="clearfix p-t" ng-show="detailFlag[0]">
                        <div class="form-group" ng-show="tabFlag.name =='编辑' ">
                            <label class="col-xs-2 control-label"  style="width:200px;" ><span translate>包装箱编码</span>：</label>
                            <div class="col-xs-5 wrapper-none">
                                <input type="text" name="packageNo" class="form-control"
                                    ng-model="detailInfo.packageNo" yb-focus maxlength="20" ng-disabled="true">
                            </div>
                            <!-- <div class="col-xs-4 msg-block"
                                ng-show="form.packageNo.$dirty || (form.packageNo.$invalid && submitted)">
                                <div class="error-msg"
                                    ng-if="form.packageNo.$error.required && !form.packageNo.focused">
                                    <i class="yb-icon ico-times-circular"></i><span translate>必填项，请填写</span>
                                </div>
                            </div> -->
                        </div>
                        <div class="form-group">
                            <label class="col-xs-2 control-label"  style="width:200px;" ><i>*</i><span translate>包装箱名称</span>：</label>
                            <div class="col-xs-5 wrapper-none">
                                <input type="text" name="packageName" class="form-control"
                                    ng-model="detailInfo.packageName" required maxlength="20">
                            </div>
                            <div class="col-xs-4 msg-block"
                                ng-show="form.packageName.$dirty || (form.packageName.$invalid && submitted)">
                                <div class="error-msg"
                                    ng-if="form.packageName.$error.required && !form.packageName.focused">
                                    <i class="yb-icon ico-times-circular"></i><span translate>必填项，请填写</span>
                                </div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-2 control-label" style="width:200px;"><span translate>规格型号（长*宽*高/mm）</span>：</label>
                            <div class="col-xs-5 wrapper-none">
                                <input type="text" name="specLong" class="form-control pull-left" style="width:32%"
                                    ng-model="detailInfo.specLong"  yb-number-input disable-decimal="false" required yb-focus
                                    decimal-places="4" max="9999999.9999">
                                <div class="pull-left" style="width:3%;height:34px;line-height: 34px;">*</div>
                                <input type="text" name="specWidth" class="form-control pull-left" style="width:31%"
                                    ng-model="detailInfo.specWidth"  yb-number-input disable-decimal="false" required yb-focus
                                    decimal-places="4" max="9999999.9999">
                                <div class="pull-left" style="width:3%;height:34px;line-height: 34px;">*</div>
                                <input type="text" name="specHeight" class="form-control pull-left" style="width:31%"
                                    ng-model="detailInfo.specHeight"  yb-number-input disable-decimal="false" required yb-focus
                                    decimal-places="4" max="9999999.9999">
                            </div>
                            <div class="col-xs-2 msg-block pull-left"
                                ng-show="form.specLong.$dirty || (form.specLong.$invalid && submitted)">
                                <div class="error-msg"
                                    ng-if="form.specLong.$error.required && !form.specLong.focused">
                                    <i class="yb-icon ico-times-circular"></i><span translate>长度必填项，请填写</span>
                                </div>
                            </div>
                            <div class="col-xs-2 msg-block pull-left"
                                ng-show="form.specWidth.$dirty || (form.specWidth.$invalid && submitted)">
                                <div class="error-msg"
                                    ng-if="form.specWidth.$error.required && !form.specWidth.focused">
                                    <i class="yb-icon ico-times-circular"></i><span translate>宽度必填项，请填写</span>
                                </div>
                            </div>
                            <div class="col-xs-2 msg-block pull-left"
                                ng-show="form.specHeight.$dirty || (form.specHeight.$invalid && submitted)">
                                <div class="error-msg"
                                    ng-if="form.specHeight.$error.required && !form.specHeight.focused">
                                    <i class="yb-icon ico-times-circular"></i><span translate>高度必填项，请填写</span>
                                </div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-2 control-label"  style="width:200px;" ><span translate>成本费用（元）</span>：</label>
                            <div class="col-xs-5 wrapper-none">
                                <input type="text" name="cost" class="form-control"
                                    ng-model="detailInfo.cost"  yb-number-input disable-decimal="false"
                                    decimal-places="4" max="99999999999.9999">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-2 control-label"  style="width:200px;" ><span translate>重量（kg）</span>：</label>
                            <div class="col-xs-5 wrapper-none">
                                <input type="text" name="weight" class="form-control"
                                    ng-model="detailInfo.weight"  yb-number-input disable-decimal="false"
                                    decimal-places="4" max="9999999.9999">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-2 control-label"  style="width:200px;" ><i>*</i><span translate>包装方式</span>：</label>
                            <div class="col-xs-5 wrapper-none">
                                <select name="packageMethod" class="form-control"
                                    ng-model="detailInfo.packageMethod" required 
                                    ng-options="item.code as item.name for item in packageMethodList"
                                    yb-focus>
                                    <option value="" translate>请选择包装方式</option>
                                </select>
                            </div>
                            <div class="col-xs-4 msg-block"
                                ng-show="form.packageMethod.$dirty || (form.packageMethod.$invalid && submitted)">
                                <div class="error-msg"
                                    ng-if="form.packageMethod.$error.required && !form.packageMethod.focused">
                                    <i class="yb-icon ico-times-circular"></i><span translate>必选项，请选择</span>
                                </div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-2 control-label"  style="width:200px;" ><i>*</i><span translate>绑定零件</span>：</label>
                            <div class="col-xs-5 wrapper-none" ng-click="selMateriel($event)">
                                <input ng-show="false" type="text" name="materialsNo" class="form-control"
                                    ng-model="detailInfo.materialsNo" required maxlength="20">

                                <div class="form-control">{{selectedMaterialList.materialList[0].materialsDes || '请点击选择绑定零件'}}</div>
                            </div>
                            <div class="col-xs-4 msg-block"
                                ng-show="form.materialsNo.$dirty || (form.materialsNo.$invalid && submitted)">
                                <div class="error-msg"
                                    ng-if="form.materialsNo.$error.required && !form.materialsNo.focused">
                                    <i class="yb-icon ico-times-circular"></i><span translate>请点击选择绑定零件</span>
                                </div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-2 control-label"  style="width:200px;" ><span translate>备注</span>：</label>
                            <div class="col-xs-5 wrapper-none">
                                <!-- <input type="text" name="remark" class="form-control"
                                    ng-model="detailInfo.remark"  maxlength="20"> -->
                                    <textarea ng-model="detailInfo.remark" class="form-control"></textarea>
                            </div>
                        </div>
                    </div>
                </form>
            </div>
            <div class="bottom-area btn-bar single-col border-t clearfix">
                <button type="button" class="btn btn-primary m-r-sm" ng-click="saveData(form.$valid)" translate>
                    保存
                </button>
                <button type="button" class="btn btn-default" ng-click="changeTab(0)" translate>取消</button>
            </div>
            <div materiel-selector show-toolbar="toolbarConfig.showMateriel" is-default-warehouse="true" selected-list="selectedMaterialList.materialList"
                 warehouse-code="orderObj.headerInfo.outLocation" area-code="orderObj.headerInfo.outArea" mark-stock-status="true"></div>
        </div>
        <div tab heading="详情" active="activeFlag[2]" ng-if="activeFlag[2]">
            <div class="main-area d-t-35 d-b-60">
                <form name="form" class="main-wrap form-horizontal single-col p-t-xs clearfix" novalidate>
                    <div class="panel-bar clearfix">
                        <div class="pull-left">
                            <i></i><span translate>包装规格详细信息</span>
                        </div>
                        <!-- <div class="pull-right" ng-click="switchDetailBar(0)">
                            <span ng-show="!detailFlag[0]" translate translate-attr-title="展开">
                                <i class="yb-icon ico-angle-double-down"></i>
                            </span>
                            <span ng-show="detailFlag[0]" translate translate-attr-title="收起">
                                <i class="yb-icon ico-angle-double-up"></i>
                            </span>
                        </div> -->
                    </div>
                    <div class="clearfix" ng-show="detailFlag[0]">
                        <div class="form-group m-b-none">
                            <label class="col-xs-2 control-label"  style="width:200px;" ><span translate>包装箱编码</span>：</label>
                            <div class="col-xs-8 control-label text-left">
                                {{detailInfo.packageNo || "-"}}
                            </div>
                        </div>
                        <div class="form-group m-b-none">
                            <label class="col-xs-2 control-label"  style="width:200px;" ><span translate>包装箱名称</span>：</label>
                            <div class="col-xs-8 control-label text-left">
                                {{detailInfo.packageName || "-"}}
                            </div>
                        </div>
                        <div class="form-group m-b-none">
                            <label class="col-xs-2 control-label"  style="width:200px;" ><span translate>规格型号（长*宽*高/mm）</span>：</label>
                            <div class="col-xs-8 control-label text-left">
                                {{detailInfo.spec || "-"}}
                            </div>
                        </div>
                        <div class="form-group m-b-none">
                            <label class="col-xs-2 control-label"  style="width:200px;" ><span translate>成本费用（元）</span>：</label>
                            <div class="col-xs-8 control-label text-left">
                                {{detailInfo.cost || "-"}}
                            </div>
                        </div>
                        <div class="form-group m-b-none">
                            <label class="col-xs-2 control-label"  style="width:200px;" ><span translate>重量（kg）</span>：</label>
                            <div class="col-xs-8 control-label text-left">
                                {{detailInfo.weight || "-"}}
                            </div>
                        </div>
                        <div class="form-group m-b-none">
                            <label class="col-xs-2 control-label"  style="width:200px;" ><span translate>包装方式</span>：</label>
                            <div class="col-xs-8 control-label text-left">
                                {{detailInfo.packageMethodName || "-"}}
                            </div>
                        </div>
                        <div class="form-group m-b-none">
                            <label class="col-xs-2 control-label"  style="width:200px;" ><span translate>备注</span>：</label>
                            <div class="col-xs-8 control-label text-left">
                                {{detailInfo.remark || "-"}}
                            </div>
                        </div>
                        <div class="form-group m-b-none">
                            <label class="col-xs-2 control-label"  style="width:200px;" ><span translate>创建人姓名</span>：</label>
                            <div class="col-xs-8 control-label text-left">
                                {{detailInfo.createName || "-"}}
                            </div>
                        </div>
                        <div class="form-group m-b-none">
                            <label class="col-xs-2 control-label"  style="width:200px;" ><span translate>创建时间</span>：</label>
                            <div class="col-xs-8 control-label text-left">
                                {{detailInfo.createTime || "-"}}
                            </div>
                        </div>
                    </div>
                </form>
            </div>
            <div class="bottom-area btn-bar single-col border-t clearfix">
                <button type="button" class="btn btn-default" ng-click="changeTab(0)" translate>返回</button>
            </div>
        </div>
    </div>
</div>